
package com.jf.cloud.multishop.constant;


/**
 * 店铺钱包金额发生改变的原因
 * 0用户支付 1用户确认收货 2 用户退款申请 3 拒绝用户退款申请 4 提现申请 5 提现申请被拒绝
 *
 * @author zz
 */
public enum ShopWalletChangeReason {

    /**
     * 用户支付
     */
    PAY(0, "用户支付"),

    /**
     * 订单结算
     */
    SETTLED(1, "订单结算"),

    /**
     * 用户退款申请成功
     */
    ORDER_REFUND(2, "用户退款申请成功"),

    /**
     * 提现申请
     */
    APPLY_CASH(4, "提现申请"),

    /**
     * 提现申请被拒绝
     */
    REFUSE_CASH(5, "提现申请被拒绝"),

    /**
     * 通过提现申请
     */
    PASS_CASH(6, "提现申请通过"),

    /**
     * 系统发放成功
     */
    SUCCESS_CASH(7, "系统发放成功"),
    /**
     * 提现发放失败
     */
    FAIL_CASH(8, "系统发放失败"),

    /**
     * 系统扣除订单中需要颁发给用户的分销金额
     */
    DISTRIBUTION_AMOUNT(9, "扣除订单分销金额"),

    /**
     * 余额充值订单
     */
    APPLY_RECHARGE(10, "提交充值订单"),

    /**
     * 余额充值成功
     */
    SUCCESS_RECHARGE(11, "充值成功"),

    /**
     * 订单采购价差
     */
    PURCHASE_SPREAD_AMOUNT(12, "扣除订单采购价差"),

    /**
     * 商家自行处理采购价差
     */
    REFUND_SPREAD_AMOUNT(13, "商家自行处理采购价差"),

    /**
     * 预售失败结算（超时未支付尾款）
     */
    PRE_SALE_FAIL(14, "预售失败结算（超时未支付尾款）"),

    SUCCESS_QRCODE_RECHARGE(15, "收款码收款成功）"),
    ;

    private final Integer num;

    private final String shopWalletChangeReason;

    public Integer value() {
        return num;
    }

    public String getShopWalletChangeReason() {
        return shopWalletChangeReason;
    }

    ShopWalletChangeReason(Integer num, String shopWalletChangeReason) {
        this.num = num;
        this.shopWalletChangeReason = shopWalletChangeReason;
    }

    public static ShopWalletChangeReason instance(Integer value) {
        ShopWalletChangeReason[] enums = values();
        for (ShopWalletChangeReason statusEnum : enums) {
            if (statusEnum.value().equals(value)) {
                return statusEnum;
            }
        }
        return null;
    }

    public static String getReason(Integer value) {
        ShopWalletChangeReason[] enums = values();
        for (ShopWalletChangeReason statusEnum : enums) {
            if (statusEnum.value().equals(value)) {
                return statusEnum.shopWalletChangeReason;
            }
        }
        return null;
    }
}
